var e = require("../../services/api.js"), t = getApp();

Page({
    data: {
        height: "95vh",
        share: {}
    },
    onLoad: function(e) {
        var t = this;
        wx.createSelectorQuery().select("#head").boundingClientRect(function(e) {
            t.setData({
                height: wx.getSystemInfoSync().windowHeight - e.height + "px"
            });
        }).exec();
    },
    showShare: function() {
        wx.showShareMenu();
    },
    onReady: function() {},
    onShow: function() {
        var n = this;
        t.getLogin() && (0, e.getQrCode)().then(function(e) {
            200 === e.data.code && (n.setData({
                share: e.data.data
            }), n.onShareAppMessage = function() {
                return {
                    path: e.data.data.page,
                    imageUrl: "/images/shareo.jpg",
                    title: "免费的外卖才更”香“"
                };
            });
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: "免费的外卖才更”香“"
        };
    }
});